<html><head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <title>财务管理</title>
<#assign base=request.contextPath  />
  <link rel="stylesheet" href="${base}/js/layui/css/layui.css" media="all">
</head>

<body>
 <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
  <legend>财务管理</legend>
</fieldset>
<table class="layui-hide" id="table_cwgl" lay-filter="user"></table>
 <script type="text/html" id="barDemo">
     <button class="layui-btn layui-btn-sm layui-btn-normal" lay-event="edit" id="updatemother">详细信息</button>
 </script>
<script src="${base}/js/layui/layui.js" charset="utf-8"></script>
 <script type="text/javascript" src="${base}/js/zhang.js"></script>
 <script src="${base}/js/jquery.min.js"></script>
<script>

layui.use(['element','table'], function(){
	var table = layui.table
  var $ = layui.jquery
  ,element = layui.element; 
   table.render({
    elem: '#table_cwgl'
    ,url: '${base}/moenyDetailed/list'//数据接口
    ,toolbar: '#toolbarDemo'
    ,defaultToolbar: ['filter', 'print', 'exports']
    ,cols: [[
      {field:'id', templet:function(val){
          return val.LAY_INDEX
      },title: '序号',align: 'center'}
     ,{field:'consumption', title: '总计',templet:function(val){
               return val.consumption+"元"
           }, align: 'center'}
     ,{field:'roomName', title: '房间号', align: 'center'}
      ,{field:'mealName', title: '套餐名',align: 'center'}
     ,{field:'mealPrice', title: '套餐价格',templet:function(val){
               return  val.mealPrice+"元"
           }, align: 'center'}
     ,{field:'createTime', title: '订单创建时间',templet:function(val){
               return changeDateFormat(val.createTime)
           }, width:150}
     ,{field: 'right', title:'操作', toolbar: '#barDemo',width:150, align: 'center'}
    ]]
    ,id: 'testReload'
    ,page: {
           layout: ['limit', 'count', 'prev', 'page', 'next', 'skip'] //自定义分页布局
           ,theme: '#0092EF'
           ,limit:20
        }
       ,height:700
  });
    layui.form.on('select()', function(data){
        $("#demoReload").val("")
    });
    //编辑弹出层
    table.on('tool(user)', function(obj){
        var layEvent = obj.event;
        if(layEvent=="edit"){
            var data = obj.data;
            layer.open({
                type: 2,
                title: '详细信息',
                maxmin:true,
                shadeClose:false ,
                offset: 't',
                area:['100%','100%'],
                content: '${base}/moenyDetailed/MoenyInfo?homeId='+data.homeId,
                success: function (layero, index) {
                    var iframeWin = window[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象，执行iframe页的方法：iframeWin.method();
                    iframeWin.$("#homeId").val(data.homeId)


                }
            });
        }
    });
});
</script>

</body>
</html>